﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="author" content="Aowork">
    <meta name="description" content="">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no">

    <title></title>

    <link href="../css/mobile.css" rel="stylesheet" />

    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
    <script src="../js/zepto.min.js"></script>
    <script src="../js/zepto.swipe.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/config.js"></script>
    <script src="../js/uiExtend.js"></script>
    <script src="../js/wx_config.js"></script>

    <script type="text/javascript">
        jc.fnInit.push(function () {
            jc.ui.header.trigger("updateTitle", "课程学习");
        });
    </script>

    <script type="text/javascript">
        var courseId = jc.hash.get("courseId");
        if (!courseId) {
            alert("参数有误");
            window.location.href = window.ctx + "courseList/courseList.html";
        }
        else {
            $.getJSON(window.path.courseDetail, { courseId: courseId }, function (result) {
                if (result.success) {
                    var data = result.data;
                    jc.ui.courseDetails.trigger("setup", data);
                    //jc.ui.courseDetailsEditOutPut.trigger("setup", data.intro);


                    var lectureList = data.lectureList;
                    var lectureListData = [];

                    for (var i = 0, l = lectureList.length; i < l; i++) {
                        var cur = lectureList[i];

                        var object = {};

                        object.title = lectureList[i].title;

                        var btnTxt = "";
                        var btnHref = "";
                        var btnClass = "";

                        if (cur.teachingMethod == 1 && cur.liveStatus == 2) {
                            btnTxt = "进入直播";
                            btnHref = window.ctx + "player/living.html#lectureId=" + cur.lectureId;
                            btnClass = "abtn green";
                        }

                        else if (cur.teachingMethod == 1 && cur.liveStatus == 3) {
                            btnTxt = "回放";
                            btnHref = window.ctx + "player/living.html#lectureId=" + cur.lectureId;
                            btnClass = "abtn green";
                        }

                        else if (cur.teachingMethod == 2 && cur.videoStatus == 1) {
                            btnTxt = "观看视频";
                            btnHref = window.ctx + "player/video.html#lectureId=" + cur.lectureId;
                            btnClass = "abtn green";
                        }

                        else {
                            btnTxt = "暂未开始";
                            btnHref = "";
                            btnClass = "abtn gray";
                        }



                        object.btnTxt = btnTxt;
                        object.btnHref = btnHref;
                        object.btnClass = btnClass;

                        lectureListData[i] = object;
                    }


                    jc.ui.txtBtnList.trigger("setup", lectureListData);
                }
                else {
                    alert(result.desc);
                }
            });

        }


    </script>


</head>
<body>
    <div data-ui="header" class="J_header">
        <div class="h_inner"></div>
    </div>


    <div class="bgfff bb1">

        <div data-ui="courseDetails" class="J_courseDetails hidePrice" data-btn-txt="进入直播">
        </div>

    </div>



    <div class="mt10 bgfff bt1 bb1">

        <div class="J_title mt10 clearfix">
            <div class="t_left">
                <div class="l_token"></div>
                <div class="l_txt">课程大纲</div>
            </div>
        </div>

        <div data-ui="txtBtnList" class="J_txtBtnList">
            <div class="t_list">

            </div>
        </div>

    </div>





    <div data-ui="footer" class="J_footer">


    </div>


    <div data-ui="nav" class="J_nav">
        <div class="n_inner">
            <div class="i_center clearfix"></div>
        </div>
    </div>




</body>
</html>
